<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>您需要登录后才可以使用本功能</title>

    <link href="/admin/font-awesome/css/font-awesome.min.css" rel="stylesheet">

    <link href="/admin/css/login.css" rel="stylesheet" type="text/css">

    <script type="text/javascript" src="/admin/js/jquery.min.js"></script>

    <script type="text/javascript" src="/admin/js/common.js"></script>

    <script type="text/javascript" src="/admin/js/jquery.tscookie.js"></script>

    <script type="text/javascript" src="/admin/js/jquery.form.js"></script>

    <script type="text/javascript" src="/admin/js/jquery.validation.min.js"></script>

    <script src="/admin/js/jquery.supersized.min.js"></script>

    <script src="/admin/js/jquery.progressBar.js" type="text/javascript"></script>

    <script src="/static/layer/layer.js" type="text/javascript"></script>

</head>
<body>

<div class="login-layout">
    <div class="top">
        <h5><em></em></h5>
        <h2>平台管理中心</h2>
        {{--<h6>商城&nbsp;&nbsp;|&nbsp;&nbsp;资讯&nbsp;&nbsp;|&nbsp;&nbsp;圈子&nbsp;&nbsp;|&nbsp;&nbsp;微商城&nbsp;&nbsp;|&nbsp;&nbsp;统计</h6>--}}
    </div>
    <form method="post" id="form_login">
        <div class="lock-holder">
            <div class="form-group pull-left input-username">
                <label>账号</label>
                <input name="username" id="user_name" autocomplete="off" type="text" class="input-text" value=""
                       required>
            </div>
            <i class="fa fa-ellipsis-h dot-left"></i> <i class="fa fa-ellipsis-h dot-right"></i>
            <div class="form-group pull-right input-password-box">
                <label>密码</label>
                <input name="password" id="password" class="input-password" autocomplete="off" type="password" required
                       pattern="[\S]{6}[\S]*"
                       title="密码不少于6个字符">
            </div>
        </div>
        <div class="avatar"><img src="/admin/images/login/admin.png" alt=""></div>
        <div class="submit"> <span>
<div class="code">
    <div class="arrow"></div>
    <div class="code-img"><img src="{{url('admin/captcha')}}" name="codeimage" id="codeimage" border="0"/></div>
    <a href="JavaScript:void(0);" id="hide" class="close" title="关闭"><i></i></a><a href="JavaScript:void(0);"
                                                                                   onclick="javascript:document.getElementById('codeimage').src='{{url('captcha')}}?r='+Math.random()"
                                                                                   class="change"
                                                                                   title="看不清,点击更换验证码"><i></i></a></div>
             <input name="captcha" type="text" required class="input-code" id="captcha" placeholder="输入验证"
                    pattern="[A-z0-9]{4}" title="验证码为4个字符" autocomplete="off" value="">
      </span> <span>
      <input name="" class="input-button" type="submit" value="登录">
      </span></div>
        <div class="submit2"></div>
    </form>
    <div class="bottom">
    </div>
</div>
<script>
    $(function () {
        $.supersized({
            // 功能
            slide_interval: 4000,
            transition: 1,
            transition_speed: 1000,
            performance: 1,
            // 大小和位置
            min_width: 0,
            min_height: 0,
            vertical_center: 1,
            horizontal_center: 1,
            fit_always: 0,
            fit_portrait: 1,
            fit_landscape: 0,
            // 组件
            slide_links: 'blank',
            slides: [
                {image: '/admin/images/login/1.jpg'},
                {image: '/admin/images/login/2.jpg'},
                {image: '/admin/images/login/3.jpg'},
                {image: '/admin/images/login/4.jpg'},
                {image: '/admin/images/login/5.jpg'}
            ]
        });
        //显示隐藏验证码
        $("#hide").click(function () {
            $(".code").fadeOut("slow");
        });
        $("#captcha").focus(function () {
            $(".code").fadeIn("fast");
        });
        //跳出框架在主窗口登录
        if (top.location != this.location)    top.location = this.location;
        $('#user_name').focus();
        if ($.browser.msie && ($.browser.version == "6.0" || $.browser.version == "7.0")) {
            window.location.href = '{{url('ie6update')}}';
        }
        $("#captcha").nc_placeholder();
        //动画登录
        $('.btn-submit').click(function (e) {
            $('.input-username,dot-left').addClass('animated fadeOutRight')
            $('.input-password-box,dot-right').addClass('animated fadeOutLeft')
            $('.btn-submit').addClass('animated fadeOutUp')
            setTimeout(function () {
                        $('.avatar').addClass('avatar-top');
                        $('.submit').hide();
                        $('.submit2').html('<div class="progress"><div ' +
                                'class="progress-bar progress-bar-success" aria-valuetransitiongoal="100"></div></div>');
                        $('.progress .progress-bar').progressbar({
                            done: function () {
                                $('#form_login').submit(function(){ ajaxPost(); });
                            }
                        });
                    },
                    300);
        });
        // 回车提交表单
        $('#form_login').keydown(function (event) {
            if (event.keyCode == 13) {ajaxPost();}
        });
    });
    function ajaxPost()
    {
        $("#form_login").validate({
            submitHandler: function(form)
            {
                $(form).ajaxSubmit({
                            type: "post",
                            url: "{{action('Admin\LoginController@postLogin')}}",
                            dataType: "json",
                            success: function(result){
                                //返回提示信息
                                layer.msg(result.msg);
                                if (result.status == 1) {
                                    window.location.href = result.url;
                                }
                            }
                        }
                );
            }
        });
    }
</script>
</body>
</html>
